<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改商品属性参数')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-attribute-edit" th:object="${productAttribute}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">商品类型：</label>
                <div class="col-sm-8">
                    <!--<input name="productAttributeCategoryId" th:field="*{productAttributeCategoryId}" class="form-control" type="text">-->
                    <select class="form-control" name="productAttributeCategoryId">
                        <!--<option value="">请选商品类型</option>-->
                        <option th:each="productAttributeCategory : ${productAttributeCategoryList}" th:value="${productAttributeCategory.id}" th:text="${productAttributeCategory.name}" th:field="*{productAttributeCategoryId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">属性选择类型：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('product_attribute_select_type')}">
                        <input type="radio" th:id="${dict.dictCode}" name="selectType" th:value="${dict.dictValue}" th:field="*{selectType}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">属性录入方式：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('product_attribute_input_type')}">
                        <input type="radio" th:id="${dict.dictCode}" name="inputType" th:value="${dict.dictValue}" th:field="*{inputType}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">可选值列表，以逗号隔开：</label>
                <div class="col-sm-8">
                    <input name="inputList" th:field="*{inputList}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">排序：</label>
                <div class="col-sm-8">
                    <input name="sort" th:field="*{sort}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">分类筛选样式：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('product_attribute_filter_type')}">
                        <input type="radio" th:id="${dict.dictCode}" name="filterType" th:value="${dict.dictValue}" th:field="*{filterType}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">检索类型：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('product_attribute_search_type')}">
                        <input type="radio" th:id="${dict.dictCode}" name="searchType" th:value="${dict.dictValue}" th:field="*{searchType}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">相同属性产品是否关联：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('product_attribute_related_status')}">
                        <input type="radio" th:id="${dict.dictCode}" name="relatedStatus" th:value="${dict.dictValue}" th:field="*{relatedStatus}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否支持手动新增：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('product_attribute_hand_add_status')}">
                        <input type="radio" th:id="${dict.dictCode}" name="handAddStatus" th:value="${dict.dictValue}" th:field="*{handAddStatus}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">属性的类型：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('product_attribute_type')}">
                        <input type="radio" th:id="${dict.dictCode}" name="type" th:value="${dict.dictValue}" th:field="*{type}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "mall/attribute";
        $("#form-attribute-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-attribute-edit').serialize());
            }
        }
    </script>
</body>
</html>